package com.bao.work.idcard;

import com.bao.work.idcard.impl.PeopleManagementImpl;

import java.util.Scanner;

/**
 * @author baoye
 * @date 2024-07-31/19:31
 */
public class MainApp {
    public static final PeopleManagement PEOPLE_MANAGEMENT = new PeopleManagementImpl();

    public static void main(String[] args) {
        while (true) {
            System.out.println("--------公民身份管理系统--------");
            System.out.println("\t\t1.信息录入");
            System.out.println("\t\t2.信息查询");
            System.out.println("\t\t3.信息修改");
            System.out.println("\t\t4.信息删除");
            System.out.println("\t\t5.退出");
            System.out.println("-----------------------------");
            System.out.println("--请选择--");
            int order;
            try{
                order=new Scanner(System.in).nextInt();
            }catch (Exception e){
                System.err.println("只能输入数字!");
                continue;
            }
            switch (order) {
                case 1:
                    PEOPLE_MANAGEMENT.insertPeople();
                    break;
                case 2:
                    PEOPLE_MANAGEMENT.selectPeople();
                    break;
                case 3:
                    PEOPLE_MANAGEMENT.updatePeople();
                    break;
                case 4:
                    PEOPLE_MANAGEMENT.deletePeople();
                    break;
                default:
                    System.err.println("退出");
                    System.exit(0);
                    break;
            }
        }
    }
}
